package 其他.报数游戏;

import java.util.Scanner;

public class Main_2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int m = scanner.nextInt();
        int[] ints = new int[100];
        for (int i = 0; i < ints.length; i++) {
            ints[i]=1;
        }

        int count =0;
        int exitCount=0;
        int index=0;
        int time = 0 ;
        while (100-exitCount>=m){
            time++;
            if (index==99){

                if (ints[index]==1) { // 有人了才计数
                    count++; // 计数器 + 1
                    if (count == m) {
                        ints[99] = 0; // 标记退出
                        exitCount++;
                        count = 0; // 重新计数
                    }
                }

                index=0;// 下次index 从0开始

            }else {

                if (ints[index]==1){

                    count++;
                    if (count==m){
                        ints[index]=0;
                        exitCount++;
                        count=0;// 有人退出,则计数器归零
                    }
                }
                index++;
            }
        }

        for (int i = 0; i < ints.length; i++) {
            if (ints[i]!=0){
                System.out.println(i+1);
            }
        }

        System.out.println("一共执行了"+time+"轮");
    }
}
